<<<<<<< HEAD NTOLab13

Team Section



Arie’s Subquestion


## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.


Ethan’s Subquestion


## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.


Anderson’s Subquestion


## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

## Warning: Ignoring unknown parameters: xintercept
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.


David’s Subquestion


Is there a coorelation between the percent of money goverment spends on higher level education and the average income of a person on a global level??

Null Hypothesis: There is no correlation between the percent of money goverments spent on higher education and the average income of a person on a global level.

Alternative Hypothesis: There is correlation between the percent of money goverments spent on higher education and the average income of a person on a global level.



mapp <- function(data){
data <- data[-1]
  mean = map(data,mean)
  median = map(data,median)
  max = map(data,max)
  min = map(data,min)

x <- as.tibble(mean)
x1 <- as.tibble(median)
x3 <- as.tibble(min)
x4 <-as.tibble(max)
x5 <- c("mean","median","min","max")

y1 <- full_join(x,x1)
y2 <- full_join(x3,x4)
yote <- full_join(y1,y2) %>% mutate(map_type = x5)
yote <- yote[c(3,2,1)]

print(yote)
 }

mapp(GDP)
## # A tibble: 4 x 3
##   map_type  income  year
##   <chr>      <dbl> <dbl>
## 1 mean       6393.  1920
## 2 median     1640   1920
## 3 min         247   1800
## 4 max      182000   2040
mapp(cost)
## # A tibble: 4 x 3
##   map_type    cost  year
##   <chr>      <dbl> <dbl>
## 1 mean       71.7  2007.
## 2 median     30.4  2008 
## 3 min         2.85 1995 
## 4 max      2530    2017

Ryan’s Subquestion


Subquestion: What is the correlation between gender ratio in primary and secondary school and the HDI index for a country?

This contributes to answering the overall question because it incorporates the overarching theme of education and how it relates to other sectors of a country.

Null hypothesis: There is a significant correlation between the ratio of boys to girls in primary and secondary school and the HDI index of a country

Alternative hypothesis: There is not a significant correlation between the ratio of boys to girls in primary and secondary school and the HDI index of a country.

The test statistic is the correlation.


funk <- function(df, fun) {
  out <- vector("double", length(df))
  for (i in seq_along(df)) {
    out[i] <- fun(df[[i]])
  }
  out
}

merged1 <- merged %>% transmute(hdi = hdi_2015, ratio = ratio_2015)
funk(merged1, sd) #find standard deviation of hdi and ratio
## [1] 0.16079952 0.07332416
hdi1 <-merged1$hdi

The function above finds the standard deviation of HDI index and ratio.


##   [1] 0.479 0.764 0.786 0.827 0.743 0.939 0.893 0.824 0.579 0.795 0.796
##  [12] 0.896 0.706 0.485 0.607 0.674 0.754 0.865 0.794 0.402 0.404 0.518
##  [23] 0.920 0.648 0.396 0.847 0.738 0.727 0.435 0.776 0.474 0.827 0.775
##  [34] 0.856 0.878 0.925 0.473 0.726 0.722 0.739 0.680 0.420 0.865 0.448
##  [45] 0.895 0.897 0.769 0.926 0.579 0.866 0.754 0.640 0.625 0.836 0.921
##  [56] 0.624 0.689 0.774 0.923 0.899 0.887 0.903 0.794 0.800 0.664 0.586
##  [67] 0.830 0.763 0.497 0.427 0.912 0.848 0.898 0.748 0.512 0.476 0.789
##  [78] 0.442 0.856 0.513 0.781 0.762 0.699 0.735 0.807 0.418 0.558 0.924
##  [89] 0.915 0.353 0.949 0.796 0.550 0.684 0.788 0.740 0.682 0.855 0.843
## [100] 0.856 0.802 0.804 0.498 0.704 0.574 0.494 0.776 0.782 0.420 0.845
## [111] 0.890 0.666 0.901 0.418 0.884 0.722 0.490 0.725 0.541 0.913 0.939
## [122] 0.740 0.606 0.767 0.910 0.920 0.701 0.597 0.767

## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.


Who Did What


======= NTOLab13

Team Section



Arie’s Subquestion


<<<<<<< Updated upstream

##   1999.x   2015.x   1999.y   2015.y 
## 16.21304 14.48277 23.45085 12.41970
=======

>>>>>>> Stashed changes

Ethan’s Subquestion


<<<<<<< Updated upstream

## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

=======

## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

relevant_stats <- function(df, stat_type){
  
  if (stat_type == "spread") {
    
    type1 <- "Standard Deviation(s)"
    output1 <- map_dbl(df, sd)
    type2 <- "Inter-Quartile Range(s)"
    output2 <- map_dbl(df, IQR)
    list(type1, output1, type2, output2)
    
  } else if (stat_type == "average") {
    
    type1 <- "Median(s)"
    output1 <- map_dbl(df, median)
    type2 <- "Mean(s)"
    output2 <- map_dbl(df, mean)
    list(output1, output2)
    
  } else if (stat_type == "extreme") {
    
    type1 <- "Max(s)"
    output1 <- map_dbl(df, max)
    type2 <- "Min(s)"
    output2 <- map_dbl(df, min)
    list(type1, output1, type2, output2)
    
  } else {
    
    output1 <- "Please Enter a Known Stat Type (spread, average, extreme)"
    output1
  }

  
}
## [[1]]
## [1] "Max(s)"
## 
## [[2]]
##   math_scores_2007   outofschool_2007                pop 
##       5.700000e+02       1.040000e+06       2.235470e+08 
## out_of_school_perc 
##       4.546778e-02 
## 
## [[3]]
## [1] "Min(s)"
## 
## [[4]]
##   math_scores_2007   outofschool_2007                pop 
##       3.070000e+02       3.710000e+02       7.884570e+05 
## out_of_school_perc 
##       1.529796e-04
>>>>>>> Stashed changes

Anderson’s Subquestion


<<<<<<< Updated upstream
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

## Warning: Ignoring unknown parameters: xintercept
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

=======
## Warning: Ignoring unknown parameters: xintercept
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

## Warning: Ignoring unknown parameters: xintercept
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

>>>>>>> Stashed changes

David’s Subquestion


<<<<<<< Updated upstream

Is there a coorelation between the percent of money goverment spends on higher level education and the average income of a person on a global level??

Null Hypothesis: There is no correlation between the percent of money goverments spent on higher education and the average income of a person on a global level.

Alternative Hypothesis: There is correlation between the percent of money goverments spent on higher education and the average income of a person on a global level.


## # A tibble: 4 x 3
##   map_type  income  year
##   <chr>      <dbl> <dbl>
## 1 mean       6393.  1920
## 2 median     1640   1920
## 3 min         247   1800
## 4 max      182000   2040
## # A tibble: 4 x 3
##   map_type    cost  year
##   <chr>      <dbl> <dbl>
## 1 mean       71.7  2007.
## 2 median     30.4  2008 
## 3 min         2.85 1995 
## 4 max      2530    2017

Ryan’s Subquestion


## [1] 0.16079952 0.07332416
##   [1] 0.479 0.764 0.786 0.827 0.743 0.939 0.893 0.824 0.579 0.795 0.796
##  [12] 0.896 0.706 0.485 0.607 0.674 0.754 0.865 0.794 0.402 0.404 0.518
##  [23] 0.920 0.648 0.396 0.847 0.738 0.727 0.435 0.776 0.474 0.827 0.775
##  [34] 0.856 0.878 0.925 0.473 0.726 0.722 0.739 0.680 0.420 0.865 0.448
##  [45] 0.895 0.897 0.769 0.926 0.579 0.866 0.754 0.640 0.625 0.836 0.921
##  [56] 0.624 0.689 0.774 0.923 0.899 0.887 0.903 0.794 0.800 0.664 0.586
##  [67] 0.830 0.763 0.497 0.427 0.912 0.848 0.898 0.748 0.512 0.476 0.789
##  [78] 0.442 0.856 0.513 0.781 0.762 0.699 0.735 0.807 0.418 0.558 0.924
##  [89] 0.915 0.353 0.949 0.796 0.550 0.684 0.788 0.740 0.682 0.855 0.843
## [100] 0.856 0.802 0.804 0.498 0.704 0.574 0.494 0.776 0.782 0.420 0.845
## [111] 0.890 0.666 0.901 0.418 0.884 0.722 0.490 0.725 0.541 0.913 0.939
## [122] 0.740 0.606 0.767 0.910 0.920 0.701 0.597 0.767
<<<<<<< Updated upstream

## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

* I am answering the subquestion: what is the correlation between gender ratio in primary and secondary school and the HDI index for a country.

=======

## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

* I am answering the subquestion: what is the correlation between gender ratio in primary and secondary school and the HDI index for a country.

>>>>>>> Stashed changes

Who Did What


>>>>>>> master